<!--<div id="fb-root"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>-->
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="maintable">
  <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td valign="top"><table width="100%" align="center" cellpadding="2" cellspacing="2" border="0">
              <tr>
                <td valign="top" bgcolor="#FFFFFF"><form name="frmSearch" method="post" action="<?php echo $search_link;?>">
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td class="block-block">Email Template Search Panel</td>
                      </tr>
                      <tr>
                        <td class="border"><table width="100%" border="0" cellspacing="2" cellpadding="0">
                            <tr>
                              <td width="14%" align="right"><strong>Search By :</strong></td>
                              <td width="86%" valign="top" colspan="3">&nbsp;<select name="searchField" id="searchField" class="SELECT">
                                  <option value="" >Select Search Type</option>
                                  <option value="template_name" <?php if($params['searchField']=='template_name') echo 'selected';?> >Template Name</option>
                                  <option value="template_code" <?php if($params['searchField']=='template_code') echo 'selected';?>>Template Code</option>
								  <!-- <option value="from_name" <?php //if($params['searchField']=='from_name') echo 'selected';?>>From Name</option>//-->
								  <!-- <option value="from_email" <?php //if($params['searchField']=='from_email') echo 'selected';?>>From Email</option>//-->
								  <option value="subject" <?php if($params['searchField']=='subject') echo 'selected';?>>Subject</option>
								  <!--<option value="email_body" <?php //if($params['searchField']=='email_body') echo 'selected';?>>Email Body</option>//-->
                                </select>
                                &nbsp;
                                <input type="text" name="searchText" id="searchText" class="textbox" value="<?php echo $params['searchText'];?>" />
                                &nbsp;
                                <input type="submit" class="textbox" value="Search" />
                                &nbsp;
                                <input name="btnShowAll" type="button" class="textbox" value="Show All" onClick="javascript:show_all('<?php echo $showall_link; ?>');" />
                                </td>
                            </tr>
							<tr>
								<td align="right"><strong>Display #:</strong> </td>
								<td colspan="3">&nbsp;<select name="searchDisplay" id="searchDisplay" onchange="refreshSerachDesplay();">
									<option value="5" <?php echo ($params['searchDisplay']==5)?'selected':''?>>5</option>
									<option value="10" <?php echo ($params['searchDisplay']==10)?'selected':''?>>10</option>
									<option value="15" <?php echo ($params['searchDisplay']==15)?'selected':''?>>15</option>
									<option value="20" <?php echo ($params['searchDisplay']==20)?'selected':''?>>20</option>
									<option value="25" <?php echo ($params['searchDisplay']==25)?'selected':''?>>25</option>
									<option value="30" <?php echo ($params['searchDisplay']==30)?'selected':''?>>30</option>
									<option value="35" <?php echo ($params['searchDisplay']==35)?'selected':''?>>35</option>
									<option value="40" <?php echo ($params['searchDisplay']==40)?'selected':''?>>40</option>
									<option value="45" <?php echo ($params['searchDisplay']==45)?'selected':''?>>45</option>
									<option value="50" <?php echo ($params['searchDisplay']==50)?'selected':''?>>50</option>
								</select><input type="hidden" name="sortType" id="sortType" value="<?php echo $params['sortType'];?>" />
                                <input type="hidden" name="sortField" id="sortField" value="<?php echo $params['sortField'];?>" /></td>
							</tr>
                          </table></td>
                      </tr>
                    </table>
                  </form></td>
              </tr>
              <tr>
                <td valign="top" bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td class="block-block">Email Template Management (<?php echo $total_rows;?>)</td>
                    </tr>
                    <tr>
                      <td align="left" valign="top" class="border"><table width="100%" border="0" cellspacing="2" cellpadding="2">
                          <tr>
                            <td width="97%">&nbsp;</td>                            
                            <td width="1%" align="right"><a href="<?php echo $reload_link?>" title=" Refresh the page "> <img border="0" src="<?php echo CSS_IMAGES_JS_BASE_URL;?>images/icon_reload.gif" alt="" /></a></td>
                            <td width="1%" align="right"><a href="<?php echo $add_link?>" title=" Add Email Template "><img src="<?php echo CSS_IMAGES_JS_BASE_URL;?>images/plus_icon.gif" border="0" alt="" /></a></td>
                            <td width="1%" align="right"><a href="javascript:;" onclick="javascript: Delete_all('<?php echo $delete_all_link?>');" title=" Delete All "><img src="<?php echo CSS_IMAGES_JS_BASE_URL;?>images/delete_icon.gif" alt="" border="0"></a></td>
                          </tr>
                        </table>
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td align="left" valign="top" style="padding:10px 0px 10px 0px;"><table width="100%" border="0" cellspacing="1" cellpadding="0">
                                <tr align="center">
                                  <td width="4%" class="block-block"><input type="checkbox"  name="checkAllAuto" id="checkAllAuto" value="0"/></td>
								  <td class="block-block" align="left"><?php echo tableOrdering("Template Name","template_name",$params['sortField'],$params['sortType']); ?></td>
                                  <td width="29%" nowrap="nowrap" class="block-block" align="left"><?php echo tableOrdering("Template Code","template_code",$params['sortField'],$params['sortType']); ?></td>
                                  <td width="26%" nowrap="nowrap" class="block-block" align="left"><?php echo tableOrdering("Subject","subject",$params['sortField'],$params['sortType']); ?> </td>
								  <td width="5%" class="block-block">Edit</td>
                                  <td width="6%" class="block-block">Delete</td>
                                </tr>
                                <?php
								if($recordset)
								{
									for($i=0; $i<count($recordset); $i++)
									{
										$editLink = str_replace("{{ID}}",$recordset[$i]['id'],$edit_link);							
										$deleteLink = str_replace("{{ID}}",$recordset[$i]['id'],$delete_link);
										if($i%2==0) $style_td ='gray-block' ; else $style_td ='blue-block';
								?>
                                <tr align="center" class="<?php echo $style_td;?>">
								  <td><input type="checkbox" name="check_box" value="<? echo $recordset[$i]['id'];?>" /></td>
                                  <td align="left"><?php echo $recordset[$i]['template_name'];?></td>
                                  <td align="left"><?php echo $recordset[$i]['template_code'];?></td>
                                  <td align="left"><?php echo $recordset[$i]['subject'];?></td>
								  <td><a href="<?php echo $editLink;?>" title=" Edit Email Template "><img src="<?php echo CSS_IMAGES_JS_BASE_URL;?>images/edit_icon.gif" alt="" border="0"></a></td>
                                  <td><a href="javascript:Delete('<?php echo $deleteLink;?>');" title=" Delete Email Template "><img src="<?php echo CSS_IMAGES_JS_BASE_URL;?>images/delete_icon.gif" alt="" border="0"></a></td>
								</tr>
                                <?php	
									}
								}
								else
								{
								?>
                                <tr>
                                  <td height="100" colspan="6" align="center" valign="middle" class="blue-block">No Records Found</td>
                                </tr>
								<?php
								}
								?>
								<tr>
								   <td colspan="6" align="center">&nbsp;</td>
								</tr>
								<tr>
								   <td colspan="6" align="center"><?php echo $this->pagination->create_links();?></td>
								</tr>
                              </table></td>
                          </tr>
                        </table></td>
                    </tr>
                  </table></td>
              </tr>
            </table></td>
        </tr>
        <tr>
          <td>&nbsp;</td>
        </tr>
      </table></td>
  </tr>
</table>
<!--<iframe src="//www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2Fspaciofurniture&amp;width=400&amp;height=250&amp;show_faces=true&amp;colorscheme=light&amp;show_border=true&amp;header=true" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:292px; height:590px;" allowTransparency="true"></iframe>
<div class="fb-like" data-href="http://dev8.indusnettechnologies.com/LeagueGuru/webadmin/setting/email_setting" data-send="true" data-width="450" data-show-faces="false"></div>-->